package com.lin.dao;

import com.lin.pojo.Promotion;
import com.lin.pojo.Wares;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface PromotionDao {
    Promotion findPromotionById(@Param("id") Integer id, @Param("storeId") Integer storeId);

    void insertPromotion(Promotion promotionInfo);

    void insertPromotionRule(@Param("type") String type, @Param("promotionId") Integer promotionId,
                             @Param("fullPrice") String s, @Param("cutPrice") String s1);

    List<Wares> findAllWaresWhichCan(@Param("type") String promotionType, @Param("category1IdOrWaresId") String category1IdOrWaresId, @Param("storeId") int storeTd);

    List<Integer> getPromotionWaresId(@Param("promotionId") Integer promotionId);

    List<Integer> selectPromotionWares(@Param("promotionId") Integer promotionId, @Param("waresId") Integer waresId);

    void insertPromotionWares(@Param("promotionId") Integer promotionId, @Param("waresId") Integer waresId);

    int deletePromotionWares(@Param("promotionId") Integer promotionId, @Param("waresId") Integer waresId);

    void updatePromotionStatus(@Param("storeId") int storeId);

    List<Promotion> getPromotion(@Param("searchName") String searchName,
                                 @Param("searchType") String searchType,
                                 @Param("searchStartDate") String searchStartDate,
                                 @Param("searchEndDate") String searchEndDate,
                                 @Param("searchStatus") String searchStatus,
                                 @Param("storeId") int storeId);


    Integer updatePromotionMark(@Param("promotionId") int promotionId,
                                @Param("storeId") int storeId);


    Integer deletePromotionInfo(@Param("promotionId") int promotionId,
                                @Param("storeId") int storeId);


    List<Map<String, Object>> getPromotionRule(@Param("promotionId") String promotionId);

}
